package com.example.springdemo.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

//@Component
@Configuration
public class MyConfig {

//    @Bean
//    public CustomerByAnno getCustomerByAno() {
//        CustomerByAnno ano = new CustomerByAnno();
//        ano.setId(123);
//        ano.setUsername("admin123");
//        ano.setPassword("pwd123");
//        return ano;
//    }

    @Autowired
    CustomerByAnno anno;
    public void setInfo() {
        anno.setId(888);
        anno.setUsername("admin888");
        anno.setPassword("pwd888");
    }
    public void getInfo() {
        System.out.println("id=" +anno.getId() +
                " username=" + anno.getUsername() + " pwd=" + anno.getPassword());
    }
}
